1. Field of the Invention
The present invention relates generally to the detection of signals, such as dual tone multi-frequency (DTMF) coded signals, and more particularly, to detecting signals with improved detection sensitivity by using automatic gain control.
2. Description of the Related Art
DTMF is the signaling standard for the Touch Tone system. Two tones are combined to define a DTMF digit. Table 1 shows the matrix of frequencies used to encode the 16 DTMF symbols on a typical 4xc3x974 matrix telephone keypad. Each DTMF tone consists of two sine waves. One sine wave is from the low-frequency band (row frequency), and the other frequency is from the high-frequency band (column frequency).
Various methods have been used for DTMF generation and detection. Previously, analog circuitry had been used to generate and decode DTMF digits. More recently, the functions have been implemented using digital signal processors (DSP) to improve the accuracy, precision, stability, reprogrammability, and cast. A popular DSP algorithm for DTMF detection is the Goertzel algorithm. One such previous method is described in U.S. Pat. No. 5,644,634, issued to Zheng-yi Xie et al., entitled xe2x80x9cSystem and Method for Dual Tone Multifrequency Detection Using Variable Frame Widths,xe2x80x9d the specification of which is hereby incorporated by reference in its entirety.
In general, a DTMF detector examines the line or communication channel for the presence of two sinusoids using dedicated frequency domain algorithms, including modified Goertzel algorithms, DFT/FFTs, auto-correlation, zero crossing counting, and narrow band filter-based methods, among others.
A common technique for determining energy values in the frequency domain is performed by transforming the time domain sampling data to frequency domain data using a variant of the discrete Fourier transform (DFT) called the Goertzel algorithm. The transfer function for the Goertzel algorithm is:                                           H            k                    =                                    1              -                              ⅇ                                                      -                    j                                    ⁢                                      xe2x80x83                                    ⁢                  2                  ⁢                                      xe2x80x83                                    ⁢                  Π                  ⁢                                      xe2x80x83                                    ⁢                                      k                    N                                                                                      1              -                              c                ·                                  z                                      -                    1                                                              +                              z                                  -                  2                                                                    ,                            (        1        )            
where c is the Goertzel coefficient,   c  =      2    ⁢          xe2x80x83        ⁢    cos    ⁢          xe2x80x83        ⁢          (              2        ⁢                  xe2x80x83                ⁢        π        ⁢                  xe2x80x83                ⁢                  k          N                    )      
and N is the number of samples in a frame. The value of k is defined by:                               k          =                                    N                              F                s                                      ·                          F              tone                                      ,                            (        2        )            
where Fs is the sampling frequency (i.e., 8 kHz in typical telephone systems), Ftone is the frequency nearest the DTMF frequency that keeps the value of k to an integer. The energy of each DTMF frequency is calculated by the feed forward and feedback phase. The feedback phase (i.e., delay value) is calculated as:
Q(n)=cxc2x7Q(nxe2x88x921)xe2x88x92Q(nxe2x88x922)+x(n),xe2x80x83xe2x80x83(3)
where Q(xe2x88x921)=Q(xe2x88x922)=0, n=0, 1, 2, . . . , Nxe2x88x921. Q(nxe2x88x921) and Q(nxe2x88x922) are feedback storage elements for a frequency point, and x(n) is the current input sample value. Q(n) is referred to as a delay value.
The energy in each DTMF frequency bin is calculated in the feedforward phase (i.e., n=N) by the equation:
E(dtmf)=Q2(nxe2x88x921)+Q2(nxe2x88x922)xe2x88x92Q(nxe2x88x921)xc2x7Q(nxe2x88x922)xc2x7c.xe2x80x83xe2x80x83(4)
After the energy of each DTMF frequency is calculated, the largest magnitude in each frequency band is compared to a threshold. If the energy in one of the bins exceeds the threshold, a DTMF tone may be present.
Typically, the calculations performed to generate the Goertzel energy values are performed by a digital signal processor (DSP). On a DSP, different mathematical operations require different numbers of cycles to complete. To increase detection speed, it is desirable to minimize the number of cycles used to complete the energy value calculation. Certain DSPs have limited dynamic range. For example, a fixed point DSP may have a dynamic range of 16-bits. The DSP may encounter difficulty meeting the dynamic range of the input DTMF signal power, which may vary from 0 dBm to xe2x88x9225 dBm, per industry standards.
A DTMF signal having a high signal power can cause the DSP to overflow due to its fixed range. Proposed methods to account for the dynamic range problem have included a fixed value scaling of the input samples or using a double precision implementation to provide increased dynamic range. The scaling method introduces truncation errors into the Goertzel calculation, preventing the signal detector from reliably detecting low power signals (i.e., around xe2x88x9225 dBm). Without scaling, a high power signal will cause the DSP to overflow, preventing reliable detection of the high power signal. Using a double precision implementation greatly increases the number of clock cycles (i.e., about 400 cycles for each sample in the fame) and memory storage locations (i.e., about 32) required to perform the energy calculations.
The present invention is directed to overcoming, or at least reducing the effects of, one or more of the problems set forth above.
One aspect of the present invention is seen in a signal detector including a transform unit, a gain control unit, and an energy level threshold unit. The transform unit is adapted to receive a plurality of input samples and calculate a first plurality of delay values based on the input samples. Each delay value is based on at least one previous delay value and a current input sample. The transform unit is adapted to calculate a first energy value based on at least a subset of the first plurality of delay values. The gain control unit is adapted to determine if a selected delay value of the first plurality of delay values exceeds a predetermined threshold and scale the selected delay value, the at least one previous delay value used to calculate the selected delay value, and subsequent input samples received after the current input sample by a first amount in response to the selected delay value exceeding the predetermined threshold. The energy level threshold unit is adapted to determine the presence of a first signal in the input samples based on the first energy level.
Another aspect of the present invention is seen in a method for detecting a first signal. A plurality of input samples are received. A first plurality of delay values is calculated based on the input samples. Each delay value is based on at least one previous delay value and a current input sample. It is determined if a selected delay value of the first plurality of delay values exceeds a predetermined threshold. The selected delay value of the second plurality, the at least one previous delay value of the second plurality, and subsequent input samples received after the current input sample are scaled by a first amount in response to the selected delay value exceeding the predetermined threshold. A first energy value is calculated based on at least a subset of the first plurality of delay values. The presence of the first signal in the input samples is determined based on the first energy level.